package cn.lingyangwl.agile.member.model.mq;

import cn.lingyangwl.agile.member.constant.MemberCons;
import cn.lingyangwl.agile.member.model.entity.MemberUser;
import cn.lingyangwl.agile.model.module.mq.AbstractMQ;
import cn.lingyangwl.agile.model.module.mq.BaseMqPayload;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 会员注册
 * @author shenguangyang
 */
public class MemberRegisterMQ extends AbstractMQ {
    public static final String QUEUE = "member_register";
    public static final String KEY = QUEUE;
    public static final String EXCHANGE = MemberCons.MQ_EXCHANGE;

    public MemberRegisterMQ(MsgPayload msgPayload) {
        super(msgPayload);
    }

    @Data
    @EqualsAndHashCode(callSuper = true)
    @AllArgsConstructor
    public static class MsgPayload extends BaseMqPayload {
        private MemberUser user;
    }

    public static MemberRegisterMQ build(MemberUser user){
        return new MemberRegisterMQ(new MsgPayload(user));
    }
}
